Skip to content

feat(integrations): add Agno integration docs #1529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ohlava
Copy link

@ohlava ohlava commented Apr 10, 2025

This PR adds documentation for integrating Apify with the Agno framework, enabling users to enhance AI agents with any Apify Actor from the store.

Connected to PR#2566

Changes:

  • Added new file: sources/integrations/agno.md
  • Included code examples, prerequisites, and resources

Related Issues: Closes #1511

@ohlava ohlava requested a review from TC-MO as a code owner April 10, 2025 16:43
@ohlava ohlava marked this pull request as draft April 10, 2025 16:43
@ohlava
Copy link
Author

ohlava commented Apr 10, 2025

@jirispilka

@jirispilka jirispilka self-requested a review April 17, 2025 08:49
@ohlava ohlava marked this pull request as ready for review April 17, 2025 09:11
@jirispilka jirispilka added the t-ai Issues owned by the AI team. label Apr 25, 2025
Copy link
Contributor

@TC-MO TC-MO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick from my side, otherwise LGTM

@ohlava
Copy link
Author

ohlava commented Apr 29, 2025

@TC-MO we can merge now

@ohlava ohlava force-pushed the feat/agno-integration branch from 834bd22 to abc37be Compare April 29, 2025 08:26
@ohlava ohlava requested a review from TC-MO May 6, 2025 12:37
@ohlava
Copy link
Author

ohlava commented May 6, 2025

This is ready

@jirispilka
Copy link
Contributor

Cool. I'll review it today.

Copy link
Contributor

@jirispilka jirispilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ohlava Nice. Thanks! I left a couple of comments.
The major was that agent requires OPENAI_API_KEY


### Prerequisites

- *Apify API token*: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- *Apify API token*: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
- *Apify API token*: Obtain your API token from the [Apify console](https://console.apify.com/account/integrations).
- *OpenAI API key*: Get your API key from the [OpenAI platform](https://platform.openai.com/account/api-keys)

Comment on lines +42 to +58
from agno.agent import Agent
from agno.tools.apify import ApifyTools

# Initialize the agent with Apify tools
agent = Agent(
tools=[
ApifyTools(
actors=["apify/rag-web-browser"],
apify_api_token="YOUR_APIFY_API_TOKEN" # Replace YOUR_APIFY_API_TOKEN with your token
)
],
show_tool_calls=True,
markdown=True
)

# Fetch and display web content
agent.print_response("Extract key details from https://docs.agno.com/introduction", markdown=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from agno.agent import Agent
from agno.tools.apify import ApifyTools
# Initialize the agent with Apify tools
agent = Agent(
tools=[
ApifyTools(
actors=["apify/rag-web-browser"],
apify_api_token="YOUR_APIFY_API_TOKEN" # Replace YOUR_APIFY_API_TOKEN with your token
)
],
show_tool_calls=True,
markdown=True
)
# Fetch and display web content
agent.print_response("Extract key details from https://docs.agno.com/introduction", markdown=True)
import os
from agno.agent import Agent
from agno.tools.apify import ApifyTools
os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key
# Initialize the agent with Apify tools
agent = Agent(
tools=[ApifyTools( actors=["apify/rag-web-browser"])],
show_tool_calls=True,
markdown=True
)
# Fetch and display web content
agent.print_response("Extract key details from https://docs.agno.com/introduction", markdown=True)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add OPENAPI key, otherwise I'm got:

agno.exceptions.ModelProviderError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable

Hence it make sense to add the both keys into env vars.

Comment on lines +63 to +68
:::tip Environment variable token

You can also set the APIFY_API_TOKEN environment variable instead of passing it directly in the code.

:::

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:::tip Environment variable token
You can also set the APIFY_API_TOKEN environment variable instead of passing it directly in the code.
:::

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's skip this suggestion


:::

### Advanced Scenario: Travel Planning Agent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Advanced Scenario: Travel Planning Agent
### Advanced scenario: Travel planning agent

Comment on lines +74 to +75
from agno.agent import Agent
from agno.tools.apify import ApifyTools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from agno.agent import Agent
from agno.tools.apify import ApifyTools
import os
from agno.agent import Agent
from agno.tools.apify import ApifyTools
os.environ["APIFY_API_TOKEN"] = "YOUR_APIFY_API_TOKEN" # Replace with your Apify API token
os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY" # Replace with your OpenAI API key

Comment on lines +88 to +89
],
apify_api_token="YOUR_APIFY_API_TOKEN"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
],
apify_api_token="YOUR_APIFY_API_TOKEN"
]


:::

### Available Apify Tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Available Apify Tools
### Available Apify tools

Comment on lines +124 to +129
## Configuration Options

| Parameter | Type | Default | Description |
| ---------------------------- | ------------------- | ------- | ------------------------------------------------------------------ |
| `apify_api_token` | `str` | `None` | Apify API token (or set via APIFY_API_TOKEN environment variable) |
| `actors` | `str` or `List[str]`| `None` | Single Actor ID or list of Actor IDs to register |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Configuration Options
| Parameter | Type | Default | Description |
| ---------------------------- | ------------------- | ------- | ------------------------------------------------------------------ |
| `apify_api_token` | `str` | `None` | Apify API token (or set via APIFY_API_TOKEN environment variable) |
| `actors` | `str` or `List[str]`| `None` | Single Actor ID or list of Actor IDs to register |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this table?

I think the examples are enough. This table does not add much value IMO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it gives more structure to information and makes it more scannable. But given that it's only two options I think this could also be remade to text.

Comment on lines +29 to +31
- *Apify API token*: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
- *Python environment*: Ensure Python is installed (version 3.8+ recommended).
- *Required packages*: Install the following dependencies in your terminal:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use _ instead of * for emphasis

Suggested change
- *Apify API token*: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
- *Python environment*: Ensure Python is installed (version 3.8+ recommended).
- *Required packages*: Install the following dependencies in your terminal:
- _Apify API token_: Obtain your token from the [Apify console](https://console.apify.com/account/integrations).
- _Python environment_: Ensure Python is installed (version 3.8+ recommended).
- _Required packages_: Install the following dependencies in your terminal:

Comment on lines +124 to +129
## Configuration Options

| Parameter | Type | Default | Description |
| ---------------------------- | ------------------- | ------- | ------------------------------------------------------------------ |
| `apify_api_token` | `str` | `None` | Apify API token (or set via APIFY_API_TOKEN environment variable) |
| `actors` | `str` or `List[str]`| `None` | Single Actor ID or list of Actor IDs to register |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it gives more structure to information and makes it more scannable. But given that it's only two options I think this could also be remade to text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-ai Issues owned by the AI team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Agno framework to AI ecosystem
4 participants